using System;
using System.Security;
using Microsoft.Coding4Fun.TweetCraft.Twitter;

namespace Microsoft.Coding4Fun.TweetCraft
{
    /// <summary>
    /// Primary interface to TweetCraft functionality used by front-ends.
    /// </summary>
    public interface ITweetCraft : IReportsError, IDisposable
    {
        /// <summary>
        /// Gets a value indicating whether TweetCraft is running.
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// Gets or sets the Twitter OAuth Token to use.
        /// </summary>
        string TwitterToken { get; set; }

        /// <summary>
        /// Gets or sets the Twitter OAuth Token Secret to use.
        /// </summary>
        SecureString TwitterTokenSecret { get; set; }

        /// <summary>
        /// Gets or sets the Twitter client status.
        /// </summary>
        TwitterClientStatus TwitterStatus { get; }

        /// <summary>
        /// Raised when the Twitter status changes.
        /// </summary>
        event EventHandler TwitterStatusChanged;

        /// <summary>
        /// Gets or sets the name of the World of Warcraft account to use.
        /// </summary>
        string WowAccount { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether screenshots taken in World of Warcraft should be AutoTweeted or not.
        /// </summary>
        bool AutoTweetScreenshots { get; set; }

        /// <summary>
        /// Gets a value indicating whether the settings are complete.
        /// </summary>
        bool IsComplete { get; }

        /// <summary>
        /// Runs TweetCraft and starts background services.
        /// </summary>
        void Run();

        /// <summary>
        /// Shuts down TweetCraft and stops background services.
        /// </summary>
        void Shutdown();

        /// <summary>
        /// Raised when a tweet has been sent.
        /// </summary>
        event EventHandler<TweetEventArgs> Tweeted;

        /// <summary>
        /// Authorizes a user account via OAuth.
        /// </summary>
        void AuthorizeUser();

        /// <summary>
        /// Obtains an OAuth access token using the authorization verification code.
        /// </summary>
        string[] GetAccessToken(string verifier);
    }
}